home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / File.Type.Notes / FTN.C0.0002 < prev    next >
Encoding:
Text File  |  1990-07-27  |  8.1 KB  |  185 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. File Type Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. File Type:         $C0 (192)
  7. Auxiliary Type:    $0002
  8.  
  9. Full Name:     Apple IIgs Super Hi-Res Picture File
  10. Short Name:    "Apple Preferred" Picture
  11.  
  12. Revised by:    Matt Deatherage    September 1990
  13. Written by:    Steve Glass, Eagle Berns, Art Cabral              October 1987
  14.                & Pete McDonald
  15.  
  16. Files of this type and auxiliary type contain a Super Hi-Res picture in the 
  17. Apple-recommended format.
  18. Changes since May 1990:  Added a description of the MULTIPAT block to the 
  19. optional blocks section.  Changed Palette to be ColorTable because that's what 
  20. was really meant.
  21. _____________________________________________________________________________
  22.  
  23. Files of type $C0 and auxiliary type $0002 contain a Super Hi-Res picture in 
  24. the format recommended by Apple.  The file consists of a series of variable-
  25. length blocks (in any order), each with the same general format:
  26.  
  27.     Length               Long    Defines the length of this block, 
  28.                                  including Length itself.
  29.     Kind                 String  String used to identify the type of 
  30.                                  block.  The string is stored as a 
  31.                                  series of case-sensitive ASCII 
  32.                                  characters preceded by a length 
  33.                                  byte.  To avoid confusion, the use 
  34.                                  of uppercase characters only is 
  35.                                  recommended.
  36.     Data                 Bytes   Variable amount of block-specific 
  37.                                  data.
  38.  
  39. With this scheme, the file format is flexible and can be extended.  Standard 
  40. blocks which most applications want are defined below, however, these are not 
  41. required.  Individual applications can define other blocks.  Application-
  42. dependent information can be stored to allow other applications to ignore it.  
  43. Your application should simply ignore blocks it finds which it is not prepared 
  44. to interpret.
  45.  
  46. Data Types
  47.  
  48.     Integer              16-bit signed word.
  49.     LongInt              32-bit signed long word.
  50.     ColorEntry           16-bit word. The nibbles in the word are 
  51.                          interpreted as RGB values as follows:  $0RGB.  
  52.                          The high nibble of the high byte must be zero 
  53.                          and should be ignored when reading files.  The 
  54.                          low nibble of the high byte is the value for 
  55.                          red, the high nibble of the low byte is the 
  56.                          value for green, and the low nibble of the low 
  57.                          byte is the value for blue (see Figure 16-19 on 
  58.                          page 16-31 of the Apple IIgs Toolbox Reference).
  59.     ColorTable           16 words:  array [0..15] of ColorEntry
  60.     ModeWord             16-bit word.  The high byte determines the 
  61.                          definition of the mode. If high byte = 0, then 
  62.                          the low byte is the mode bit portion of the SCB 
  63.                          for the scan line  (see Figure 16-22 on page 16-
  64.                          34 of the Apple IIgs Toolbox Reference).  Other 
  65.                          bits are reserved and must be zero, as other 
  66.                          modes are not yet defined.
  67.     DirEntry             A two-word structure used to define the 
  68.                          characteristics of each packed line:
  69.                              Integer:     Number of bytes to unpack
  70.                              ModeWord:    Mode
  71.     PatternData          32 bytes of pattern information
  72.  
  73.  
  74. MAIN Information Block
  75.  
  76. Every file usually, but not necessarily (i.e., a file of palettes only), 
  77. includes a MAIN block.
  78.  
  79.     Length               LongInt
  80.     Kind                 String "MAIN"
  81.     MasterMode           ModeWord (from the MasterSCB of QuickDraw II.  
  82.                          When reading a file, this word should 
  83.                          be used in a SetMasterSCB call.)
  84.     PixelsPerScanLine    Integer (must not be zero)
  85.     NumColorTables       Integer (may be zero)
  86.     ColorTableArray      [0..NumColorTables-1] of ColorTable
  87.     NumScanLines         Integer (must not be zero)
  88.     ScanLineDirectory    [0..NumScanLines-1] of DirEntry
  89.     PackedScanlines      [0..NumScanLines-1] of Packed Data 
  90.                          (Obtained by performing a PackBytes call 
  91.                          on the pixel image of a single scan line.)
  92.  
  93.  
  94. PATS Information Block
  95.  
  96. The PATS block contains patterns which may be associated with the picture.
  97.  
  98.     Length               LongInt
  99.     Kind                 String "PATS"
  100.     NumPats              Integer
  101.     PatternArray         [0..NumPats-1] of PatternData
  102.  
  103.  
  104. SCIB Information Block
  105.  
  106. The SCIB block contains information relating to the current drawing pattern 
  107. for the document.  This information is used by paint programs that want to 
  108. save a foreground pattern, a background pattern, and a frame pattern with the 
  109. image.
  110.  
  111.     Length               LongInt
  112.     Kind                 String "SCIB"
  113.     ForegroundPattern    PatternData
  114.     BackgroundPattern    PatternData
  115.     FramePattern         PatternData
  116.  
  117.  
  118. PALETTES Information Block
  119.  
  120. The PALETTES block contains information on the color tables.  Its use is 
  121. intended for color table files.  If the file being saved contains a pixel 
  122. image, then the color tables associated with that picture should be saved in 
  123. the MAIN block, and this block would not be used.
  124.  
  125.     Length               LongInt
  126.     Kind                 String "PALETTES"
  127.     NumColorTables       Integer (must not be zero)
  128.     ColorTableArray      [0..NumPalettes-1] of ColorTable
  129.  
  130.  
  131. Other Information Blocks
  132.  
  133. Apple Preferred Format is an extensible graphics file format.  Since its 
  134. release, some developers have contributed other block definitions that other 
  135. developers may find to be useful.  Please feel free to incorporate these 
  136. blocks into Apple Preferred files, but you must be prepared to deal with Apple 
  137. Preferred files that do not contain these additional blocks.
  138.  
  139. MASK Information Block
  140.  
  141. The MASK block contains information on which portions of a graphic image 
  142. should be modified.  The structure is similar to that of the MAIN block.  
  143. However, the MASK array of PackedScanLines contains zeroes where no drawing is 
  144. to occur (where the image is transparent) and ones where drawing may occur 
  145. (where the image is solid).  The structural similarity to the MAIN block can 
  146. help by allowing some of your code to do double work.
  147.  
  148.     Length               LongInt
  149.     Kind                 String "MASK"
  150.     MasterMode           ModeWord (from the MasterSCB of QuickDraw II.  
  151.                          When reading a file, this word should 
  152.                          be used in a SetMasterSCB call.)
  153.     PixelsPerScanLine    Integer (must not be zero)
  154.     NumColorTables       Integer (must be zero)
  155.     NumScanLines         Integer (must not be zero)
  156.     ScanLineDirectory    [0..NumScanLines-1] of DirEntry
  157.     PackedScanlines      [0..NumScanLines-1] of Packed Data 
  158.                          (Obtained by performing a PackBytes call 
  159.                          on the pixel image of a single scan line.)
  160.  
  161.     Note:  There is no ColorTableArray, as indicated by a zero value 
  162.            in NumColorTables.
  163.     Note:  The scan lines to be packed should only contain mask values 
  164.            of one and zero.
  165.  
  166. MULTIPAL Information Block
  167.  
  168. The MUTLIPAL block contains extra color tables necessary for displaying 
  169. pictures that contain up to 3,200 colors on the screen.
  170.  
  171.     Length               LongInt
  172.     Kind                 String "MULTIPAL"
  173.     NumColorTables       Integer (should be the same as NumScanLines 
  174.                          in MAIN).  This is typically 200, but any value 
  175.                          is legal.
  176.     ColorTableArray      [0..NumColorTables-1] of ColorTable.  
  177.                          These are in the regular (0-15) order.
  178.  
  179.  
  180. Further Reference
  181. _____________________________________________________________________________
  182.   o  Apple IIgs Toolbox Reference
  183.   o  Apple IIgs Technical Note #94, Packing It In (and Out)
  184.  
  185.